package com.unei.groovy.batch

/**
 * Created by sunlei on 2015/1/15.
 */

class Mother{
    int field=1
    int foo(){
        return 2
    }

    Closure birth(param){
        def local=3
        def closure={caller->
            [this,field,foo(),local,param,caller,owner.field]
        }

        return closure
    }
}

Mother julia=new Mother()
closure=julia.birth(4)
context=closure.call(this)
context.each{println it}